//
//  LSLoginView.m
//  RAC实现登录小demo
//
//  Created by 梁森 on 2018/3/26.
//  Copyright © 2018年 梁森. All rights reserved.
//

#import "LSLoginView.h"

@implementation LSLoginView

- (instancetype)init{
    self = [super init];
    if (self) {
        [self setUpUI];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUpUI];
    }
    return self;
}

- (void)setUpUI{
    UITextField * username = [[UITextField alloc] init];
    [self addSubview:username];
    
    UITextField * password = [[UITextField alloc] init];
    [self addSubview:password];
    
    UIButton * loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [self addSubview:loginBtn];
    
    username.backgroundColor = [UIColor yellowColor];
    password.backgroundColor = [UIColor yellowColor];
    loginBtn.backgroundColor = [UIColor blackColor];
    [loginBtn setTitle:@"登录" forState:UIControlStateNormal];
    [loginBtn setTitleColor:[UIColor redColor] forState:UIControlStateDisabled];
    [loginBtn setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
    
    username.placeholder = @"用户名";
    password.placeholder = @"密码";
    
    username.frame = CGRectMake(100, 100, 100, 30);
    password.frame = CGRectMake(100, 150, 100, 30);
    loginBtn.frame = CGRectMake(100, 200, 100, 30);
    
    _username = username;
    _password = password;
    _loginBtn = loginBtn;
    
}

@end
